// eslint-disable-next-line
import { BasicLayout, RouteView } from '@/layouts'

// const RouteView = {
//   name: 'RouteView',
//   render: h => h('router-view')
// }

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '' },
    children: [
      {
        path: '/demo',
        name: 'demo',
        meta: { title: 'demo示例模块' },
        component: RouteView,
        riedirect: '/demo/demo1',
        children: [
          {
            path: '/demo/demo1',
            name: 'demo1',
            component: () => import('@/views/demo/demo1'),
            meta: { title: 'demo1实例' }
          },
          {
            path: '/demo/demo2',
            name: 'demo2',
            component: () => import('@/views/demo/demo2'),
            meta: { title: 'demo2实例' }
          },
          {
            path: '/demo/demo3',
            name: 'demo3',
            component: () => import('@/views/demo/demo3'),
            meta: { title: 'demo3实例' }
          }
        ]
      },

      // =======================负责薪酬模块 路由【开始】=========================
      {
        path: '/secretary',
        name: 'secretary',
        meta: { title: '党委书记(董事长、执行懂事)年度薪酬管理' },
        component: RouteView,
        riedirect: '/secretary/standardIssuance',
        children: [
          {
            path: '/secretary/standardIssuance',
            name: 'standardIssuance',
            component: () => import('@/views/salaryManage/secretary/standardIssuance'),
            meta: { title: '年度薪酬标准下达' }
          },
          {
            path: '/secretary/standardLedger',
            name: 'standardLedger',
            component: () => import('@/views/salaryManage/secretary/standardLedger'),
            meta: { title: '年度次粘稠标准台账' }
          }
        ]
      },
      {
        path: '/manage',
        name: 'manage',
        meta: { title: '企业负责人年度薪酬填报' },
        component: RouteView,
        riedirect: '/manage/resultReport',
        children: [
          {
            path: '/manage/resultReport',
            name: 'resultReport',
            component: () => import('@/views/salaryManage/manage/resultReport'),
            meta: { title: '年度考核结果填报' }
          },
          {
            path: '/manage/standardReport',
            name: 'standardReport',
            component: () => import('@/views/salaryManage/manage/standardReport'),
            meta: { title: '年度薪酬标准填报' }
          },
          {
            path: '/manage/standardLedger',
            name: 'standardLedger',
            component: () => import('@/views/salaryManage/manage/standardLedger'),
            meta: { title: '年度薪酬标准台账' }
          }
        ]
      },
      {
        path: '/manual',
        name: 'manual',
        meta: { title: '薪酬手册备案' },
        component: RouteView,
        riedirect: '/manual/manualReport',
        children: [
          {
            path: '/manual/manualReport',
            name: 'manualReport',
            component: () => import('@/views/salaryManage/manual/manualReport'),
            meta: { title: '薪酬手册填报' }
          },
          {
            path: '/manual/manualReview',
            name: 'manualReview',
            component: () => import('@/views/salaryManage/manual/manualReview'),
            meta: { title: '薪酬手册审核' }
          },
          {
            path: '/manual/manualArchive',
            name: 'reviewArchive',
            component: () => import('@/views/salaryManage/manual/manualArchive'),
            meta: { title: '薪酬手册归档' }
          }
        ]
      },
      // =======================负责薪酬模块 路由【结束】=========================

      // =======================职工薪酬管理模块 路由【开始】=========================
      {
        path: '/baseSetting',
        name: 'baseSetting',
        meta: { title: '基础设置' },
        component: RouteView,
        riedirect: '/baseSetting/salaryDict',
        children: [
          {
            path: '/baseSetting/salaryDict',
            name: 'salaryDict',
            component: () => import('@/views/employeeSalary/basicSetting/salaryDict'),
            meta: { title: '薪酬字典' }
          },
          {
            path: '/baseSetting/salaryPlain',
            name: 'salaryPlain',
            component: () => import('@/views/employeeSalary/basicSetting/salaryPlain'),
            meta: { title: '薪酬方案' }
          }
        ]
      },
      {
        path: '/dataImport',
        name: 'dataImport',
        meta: { title: '数据导入' },
        component: RouteView,
        riedirect: '/dataImport/salayInfoApproval',
        children: [
          {
            path: '/dataImport/salayInfoApproval',
            name: 'salayInfoApproval',
            component: () => import('@/views/employeeSalary/dataImport/salayInfoApproval'),
            meta: { title: '薪酬信息核对' }
          },
          {
            path: '/dataImport/specialDictImp',
            name: 'specialDictImp',
            component: () => import('@/views/employeeSalary/dataImport/specialDictImp'),
            meta: { title: '特殊字段录入' }
          },
          {
            path: '/dataImport/attendanceManage',
            name: 'attendanceManage',
            component: () => import('@/views/employeeSalary/dataImport/attendanceManage'),
            meta: { title: '考勤管理' }
          },
          {
            path: '/dataImport/histroyDataGenerate',
            name: 'histroyDataGenerate',
            component: () => import('@/views/employeeSalary/dataImport/histroyDataGenerate'),
            meta: { title: '历史数据整理' }
          }
        ]
      },
      {
        path: '/salaryApproval',
        name: 'salaryApproval',
        meta: { title: '薪酬核定' },
        component: RouteView,
        riedirect: '/salaryApproval/salaryCalculation',
        children: [
          {
            path: '/salaryApproval/salaryCalculation',
            name: 'salaryCalculation',
            component: () => import('@/views/employeeSalary/salaryApproval/salaryCalculation'),
            meta: { title: '工资计算' }
          },
          {
            path: '/salaryApproval/costCalculation',
            name: 'costCalculation',
            component: () => import('@/views/employeeSalary/salaryApproval/costCalculation'),
            meta: { title: '费用计算' }
          },
          {
            path: '/salaryApproval/salaryForm',
            name: 'salaryForm',
            component: () => import('@/views/employeeSalary/salaryApproval/salaryForm'),
            meta: { title: '工资表单' }
          }
        ]
      },
      {
        path: '/salaryFiles',
        name: 'salaryFiles',
        meta: { title: '薪酬档案' },
        component: RouteView,
        riedirect: '/salaryFiles/salaryCalculation',
        children: [
          {
            path: '/salaryFiles/payPush',
            name: 'payPush',
            component: () => import('@/views/employeeSalary/salaryFiles/payPush'),
            meta: { title: '支付推送' }
          },
          {
            path: '/salaryFiles/salaryFile',
            name: 'salaryFile',
            component: () => import('@/views/employeeSalary/salaryFiles/salaryFile'),
            meta: { title: '薪酬档案' }
          }
        ]
      }
      // =======================职工薪酬管理模块 路由【结束】=========================
    ]
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/dashboard/Workplace'),
        meta: { title: '首页' }
      },
      {
        path: '/mfe',
        name: 'mfe',
        meta: { title: 'test' },
        component: () => import('@/views/dashboard/test')
      },
      {
        path: '/mfe-test',
        component: () => import('@/views/dashboard/test'),
        meta: { title: 'mfe-test' }
      }
    ]
  },

  {
    path: '/404',
    component: () => import('@/views/exception/404')
  }
]
